﻿@using System.Web.Mvc.Ajax
@using System.Web.Mvc.Html
@using System.Web.Mvc;
@model WebUI.Models.FilesModel
@{
    if (Model.FilesList.Any())
    {
        var grid = new WebGrid(ajaxUpdateContainerId: "grid", rowsPerPage: int.Parse(WebUI.Resources.PageSize));
        grid.Bind(source: Model.FilesList, autoSortAndPage: false, rowCount: Model.TotalCount);
    @grid.GetHtml(mode: WebGridPagerModes.All, htmlAttributes: new { id = "grid" }, tableStyle: "main_table", headerStyle: "columns_head",
 columns: grid.Columns(

grid.Column("ReceivedTime", "Timestamp "),
         grid.Column("UserAccount", "User Name", format: (item) => Html.ActionLink((string)item.UserAccount, MVC.Reports.Details.ActionNames.UserDetails, MVC.Reports.Details.Name, new { UserName = item.UserAccount }, null)),
grid.Column("ClientMachineName", "Machine Name"),
grid.Column("FullPathName", "Directory", format: @<text>@Html.ToolTip((string)item.FullPathName, 10)</text>),
grid.Column("OperationName", "Type of access")
))
    }
    else
    {
    <p>
        No data found</p> 
    }
}
